using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace bookMaster.AssetSystem.Shell.Controles
{
    public enum Opcion { Insertar, Modificar, Guardar, Observacion };

    public partial class ctlAdministration : System.Windows.Forms.UserControl
    {
        // Eventos
        public event EventHandler InsertClick;
        public event EventHandler ModificarClick;
        public event EventHandler BorrarClick;
        public event EventHandler GuardarClick;
        public event EventHandler CancelarClick;
        public event EventHandler CopiarClick;
        public event EventHandler SeleccionarClick;
        public event EventHandler CancelarRegistroClick;
        public event EventHandler HabilitarClick;
        public event EventHandler CancelarPlanClick;

        // Propiedades para mostrar los controles
        public bool MostrarInsertar { get { return this.btnInsertar.Visible; } set { this.btnInsertar.Visible = value; }}
        public bool MostrarModificar { get { return this.btnModificar.Visible; } set { this.btnModificar.Visible = value; } }
        public bool MostrarBorrar { get { return this.btnBorrar.Visible; } set { this.btnBorrar.Visible = value; } }
        public bool MostrarGuardar { get { return this.btnGuardar.Visible; } set { this.btnGuardar.Visible = value; } }
        public bool MostrarCancelar { get { return this.btnCancelar.Visible; } set { this.btnCancelar.Visible = value; } }
        public bool MostrarCopiar { get { return this.btnCopiar.Visible; } set { this.btnCopiar.Visible = value; } }
        public bool MostrarSeleccionar { get { return this.btnSeleccionar.Visible; } set { this.btnSeleccionar.Visible = value; } }
        public bool MostrarCancelarRegistro { get { return this.btnCancelarRegistro.Visible; } set { this.btnCancelarRegistro.Visible = value; } }
        public bool MostrarHabilitar { get { return this.btnHabilitar.Visible; } set { this.btnHabilitar.Visible = value; } }
        

        // Propiedades para habilitar los controles
        public bool EnableInsertar { get { return this.btnInsertar.Enabled; } set { this.btnInsertar.Enabled = value; } }
        public bool EnableModificar { get { return this.btnModificar.Enabled; } set { this.btnModificar.Enabled = value; } }
        public bool EnableBorrar { get { return this.btnBorrar.Enabled; } set { this.btnBorrar.Enabled = value; } }
        public bool EnableGuardar { get { return this.btnGuardar.Enabled; } set { this.btnGuardar.Enabled = value; } }
        public bool EnableCancelar { get { return this.btnCancelar.Enabled; } set { this.btnCancelar.Enabled = value; } }
        public bool EnableCopiar { get { return this.btnCopiar.Enabled; } set { this.btnCopiar.Enabled = value; } }
        public bool EnableSeleccionar { get { return this.btnSeleccionar.Enabled; } set { this.btnSeleccionar.Enabled = value; } }
        public bool EnableCancelarRegistro { get { return this.btnCancelarRegistro.Enabled; } set { this.btnCancelarRegistro.Enabled = value; } }
        public bool EnableHabilitar { get { return this.btnHabilitar.Enabled; } set { this.btnHabilitar.Enabled = value; } }
        

        // Constructor
        public ctlAdministration()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            // TODO: Add custom paint code here

            // Calling the base class OnPaint
            base.OnPaint(pe);
        }

        #region "Eventos"

        private void btnInsertar_Click(object sender, EventArgs e)
        {
            if (InsertClick != null)
            {
                InsertClick(this, EventArgs.Empty);
            }
        }

        private void btnModificar_Click(object sender, EventArgs e)
        {
            if (ModificarClick != null)
            {
                ModificarClick(this, EventArgs.Empty);
            }
        }

        private void btnBorrar_Click(object sender, EventArgs e)
        {
            if (BorrarClick != null)
            {
                BorrarClick(this, EventArgs.Empty);
            }
        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (GuardarClick != null)
            {
                GuardarClick(this, EventArgs.Empty);
            }
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            if (CancelarClick != null)
            {
                CancelarClick(this, EventArgs.Empty);
            }
        }

        private void btnCopiar_Click(object sender, EventArgs e)
        {
            if (CopiarClick != null)
            {
                CopiarClick(this, EventArgs.Empty);
            }
        }

        private void btnSeleccionar_Click(object sender, EventArgs e)
        {
            if (SeleccionarClick != null)
            {
                SeleccionarClick(this, EventArgs.Empty);
            }
        }


        private void btnHabilitar_Click(object sender, EventArgs e)
        {
            if (HabilitarClick != null)
            {
                HabilitarClick(this, EventArgs.Empty);
            }
        }

        private void btnCancelarPlan_Click(object sender, EventArgs e)
        {
            if (CancelarPlanClick != null)
            {
                CancelarPlanClick(this, EventArgs.Empty);
            }
        }

        private void btnCancelarRegistro_Click(object sender, EventArgs e)
        {
            if (CancelarRegistroClick != null)
            {
                CancelarRegistroClick(this, EventArgs.Empty);
            }
        }

        #endregion


    }
}
